﻿var GT_TP015="";
var GT_TP017="";
var GT_TP018="";
var GT_TP019="";
var GT_TP020="";
var GT_TP021="";
var GT_TP022="";
var GT_TP023="";
var GT_Title="";
var GT_Body="";
var GT_Timezone="";
var GT_a="";
var GT_b="";
var GT_TimeText="";
//a 会员号，b 登陆人时区
function $GetSchedule$(a,b) 
{
    showProgressBar(false,true);
    if(GT_TimeText=="")
    {
    WebServices.User.Teach.GetUserTime(a,b,$onsuccGT$);
    }
    else
    {
      $ShowSampleGTimeBox$(GT_TimeText);  
    }
}
function $onsuccGT$(result)
{
     showProgressBar(false,true);    
        GT_TP015 = result[1][0];
        GT_TP017 = result[1][1];
        GT_TP018 = result[1][2];
        GT_TP019 = result[1][3];
        GT_TP020 = result[1][4];
        GT_TP021 = result[1][5];
        GT_TP022 = result[1][6];
        GT_TP023 = result[1][7];
        GT_Title=result[1][8];
        GT_Body=result[1][9];
        GT_Timezone=result[1][10];
       GT_TimeText="<div><h2>"+GT_Title+"</h2><div>"+GT_Body+"</div><br/><br/><span>"+GT_Timezone+"</span><br/><div><ul class=\"profile_data\">";
       var list=result[0];
       var GT_count=list.length;
       for(var i=0;i<GT_count;i++)
       {
          var obj = list[i];
          if(i==0)
          {
           GT_TimeText+="<li><div class=\"profile_nonetoday\">"+_GT_GetWeek(obj.Week)+"</div><div class=\"profile_nonetodaytime\">"+obj.FromTime+"-"+obj.ToTime;
          }
          else if (obj.Week != list[i - 1].Week && i != GT_count - 1)
          {
              GT_TimeText+="</div></li><li><div class=\"profile_nonetoday\">"+_GT_GetWeek(obj.Week)+"</div><div class=\"profile_nonetodaytime\">"+obj.FromTime+"-"+obj.ToTime;
          }
          else if (i == GT_count - 1)
          {
              if(obj.Week == list[i - 1].Week) {GT_TimeText+="<br/>"+ obj.FromTime+"-"+obj.ToTime+"</div></li>";}else
              {
              GT_TimeText+="</div></li><li><div class=\"profile_nonetoday\">"+_GT_GetWeek(obj.Week)+"</div><div class=\"profile_nonetodaytime\">"+obj.FromTime+"-"+obj.ToTime+"</div></li>";
              }
          }
          else if(obj.Week == list[i - 1].Week)
          {
               GT_TimeText+="<br />"+obj.FromTime+"-"+obj.ToTime;
          }
//          GT_TimeText+=_GT_GetWeek(obj.Week)+":   "+obj.FromTime+"-"+obj.ToTime+"<br/>";
        
       }
           GT_TimeText+= "</ul><div class=\"clear\"></div></div>" ;
    
		$ShowSampleGTimeBox$(GT_TimeText);
}
function $ShowSampleGTimeBox$(text)
{
var obj={}
     $("$divIput$").style.display = "none";
    $ShowMessageBox$(GT_Title,text,obj,$EndMessageBox$,650);
}
//va 0-6星期天到星期6
function _GT_GetWeek(va)
{
    var val=""
     switch (va)
         {
            case "0" :
            val=GT_TP017;
            break;
            case "1" :
            val=GT_TP018;
            break;
            case "2" :
            val=GT_TP019;
            break;
            case "3" :
            val=GT_TP020;
            break;
            case "4" :
            val=GT_TP021;
            break;
            case "5" :
            val=GT_TP022;
            break;
            case "6" :
            val=GT_TP023;
            break;
     }
     return val;
    
}